<?php

class Application_Model_Subjects
{
 protected $_dbTable;


    public function getdbTable() {
         if (null === $this->_dbTable) {
            $this->setDbTable('Application_Model_DbTable_Subjects');
        }
        return $this->_dbTable;
    }

    public function setdbTable($dbTable) {
        if (is_string($dbTable)) {
            $dbTable = new $dbTable();
        }
        if (!$dbTable instanceof Zend_Db_Table_Abstract) {
            throw new Exception('Invalid table data gateway provided');
        }
        $this->_dbTable = $dbTable;
        return $this;
    }

    public function save($data)
    {
        return $this->getdbTable()->insert($data);
    }
    
    public function fetchall()
    {
    	return $this->getdbTable()->fetchAll();
    }

}

